package cn.iocoder.yudao.framework.business.sse.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumCodable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;
import java.util.stream.Stream;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  这里是文件说明
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/03/15
 */
@Getter
@AllArgsConstructor
public enum SseTypeEnum implements EnumCodable {
    UNKNOWN("unknown", "未知"),
    SYSTEM_MESSAGE_UNREAD("system_message_unread", "系统消息未读"),
    ;

    private final String code;
    private final String name;

    public static SseTypeEnum codeOf(String code) {
        return Stream.of(values())
                .filter(p -> Objects.equals(p.code, code))
                .findAny()
                .orElse(UNKNOWN);
    }
}
